package com.fysports.web.module.view;

import com.fysports.web.kit.cache.DictCacheKit;
import com.fysports.web.model.system.SystemMenu;

import java.util.List;


/**
 * Created by konbluesky
 * Date : 14-8-21 下午8:19
 * Project : JdmData_WebServer
 */
public class BreadcrumbView {
    /*从缓存中取得系统应用名称*/
    private static String titlename = null;
    /*小标题*/
    private static String smalltitle = null;
    /*面包屑列表*/
    private List<SystemMenu> nodelist;

    private SystemMenu curmenu;

    //@todo 每次取得对象实例，重新赋值，需改进
    {
        titlename = DictCacheKit.getSystemName();
        smalltitle = DictCacheKit.getSystemNameLittle();
    }

    public BreadcrumbView() {

    }


    public BreadcrumbView(List<SystemMenu> slist) {
        this.nodelist = slist;
        if (curmenu == null) {
            if (nodelist != null && !nodelist.isEmpty()) {
                curmenu = nodelist.get(nodelist.size() - 1);
            }
        }
    }


    public static String getTitlename() {
        return titlename;
    }


    public static void setTitlename(String titlename) {
        BreadcrumbView.titlename = titlename;
    }


    public String getSmalltitle() {
        return smalltitle;
    }


    public void setSmalltitle(String smalltitle) {
        BreadcrumbView.smalltitle = smalltitle;
    }


    public List<SystemMenu> getNodelist() {
        return nodelist;
    }


    public void setNodelist(List<SystemMenu> nodelist) {
        this.nodelist = nodelist;
        if (nodelist != null && !nodelist.isEmpty()) {
            curmenu = nodelist.get(0);
        }
    }


    public SystemMenu getCurmenu() {
        return curmenu;
    }


    public void setCurmenu(SystemMenu curmenu) {
        this.curmenu = curmenu;
    }
}
